﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
namespace FinalCRM.App_Code
{
    public class CustomerContactsBusinessObject
    {
        public string CustomerID { get; set; }
        public string Title { get; set; }
        public string AccountName { get; set; }
        public string OfficePhone { get; set; }
        public string Mobile { get; set; }
        public string Fax { get; set; }
        public string Email { get; set; }
        public string CustomerAddress { get; set; }
        public string CompanyName { get; set; }
        public string UserName { get; set; }
        public string AccountID { get; set; }

        public static DataTable viewCustomerContact()
        {
            SqlConnection conn = null;
            DataTable dt = null;
            try
            {
                conn = new SqlConnection();
                conn.ConnectionString = "Data Source=PHYUSINHTET-PC\\SQLEXPRESS;Initial Catalog=FCRMdb;Integrated security=true";
                conn.Open();
                SqlCommand comm = new SqlCommand();
                comm.Connection = conn;
                comm.CommandText = "Select * from Contact";
                SqlDataReader dr = comm.ExecuteReader();
                dt = new DataTable();
                dt.Load(dr);

                dr.Close();
            }
            catch (SqlException e)
            {
                throw e;
            }
            finally
            {
                conn.Close();
            }
            return dt;
        }
    }
}